package jrain.flow.engine.bean;

public class ConnDef {

	private FlowDef flowDef;
	private NodeDef snode;
	private NodeDef tnode;
	private String sid;
	private String tid;
	private String name;
	private String script;

	public FlowDef getFlowDef() {
		return flowDef;
	}

	public void setFlowDef(FlowDef flowDef) {
		this.snode = flowDef.getNode(sid);
		if(this.snode != null){
			this.snode.addOutput(this);
		}
		this.tnode = flowDef.getNode(tid);
		if(this.tnode != null){
			this.tnode.addInput(this);
		}
		this.flowDef = flowDef;
	}

	public NodeDef getSnode() {
		return snode;
	}

	public void setSnode(NodeDef snode) {
		this.snode = snode;
	}

	public NodeDef getTnode() {
		return tnode;
	}

	public void setTnode(NodeDef tnode) {
		this.tnode = tnode;
	}

	public String getSid() {
		return sid;
	}

	public void setSid(String sid) {
		this.sid = sid;
	}

	public String getTid() {
		return tid;
	}

	public void setTid(String tid) {
		this.tid = tid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getScript() {
		return script;
	}

	public void setScript(String script) {
		this.script = script;
	}

}
